package com.niiwoo.civet.mobile.controller.thirdPlateform;

import lombok.Data;

import java.io.Serializable;

/**
 * 仅限网贷之家，网贷天眼登录使用
 * Created by bincun on 2018/8/31.
 */
public class LoginResult<T>  implements Serializable {
    private static final long serialVersionUID = 2015226904557564441L;

    private String result="1";//1正常响应，-1失败
    private String errorMsg;//失败描述
    private T data;

    private LoginResult(T data) {
        this.data = data;
    }

    public static <T> LoginResult<T> with(T data) {
        return new LoginResult(data);
    }


    public T getData() {
        return this.data;
    }

    public String getResult() {
        return result;
    }

    public LoginResult<T> setResult(String result) {
        this.result = result;
        return this;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public LoginResult<T> setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
        return this;
    }

    @Data
    public static class LoginToken{
        private String token = "";
    }
}
